//
//  YYSettingVC.m
//  Project
//
//  Created by Yown on 2024/2/5.
//

#import "YYSettingVC.h"
#import "YYSettingView.h"
#import "YYMineCellModel.h"

#import <BIToolModule/NSString+Device.h>
#import <BIProjectModule/BIAppDefine.h>
#import <BIToolModule/NSArray+Helper.h>

#import <Masonry/Masonry.h>

@interface YYSettingVC ()

@property (nonatomic) YYSettingView *settingView;
@property (nonatomic) NSMutableArray <YYMineCellModel *>*cellArray;

@end

@implementation YYSettingVC

#pragma mark - Life Cycle

+ (void)load {
    [[BIRouteManager sharedInstance] registerCMD:@"setting" objectOrClass:self];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupDatas];
    [self setupViews];
    [self setupLayouts];
}

- (void)setupDatas {
    NSArray *titleArray = @[@"setting_protocol", @"setting_dis"];
    
    self.cellArray = [NSMutableArray array];
    for (NSUInteger i = 0; i < titleArray.count; i++) {
        YYMineCellModel *model = [YYMineCellModel new];
        model.title = [titleArray safeObjectAtIndex:i];
        model.arrowName = @"mine_arrow";
        [self.cellArray addObject:model];
    }
}

- (void)setupViews {
    self.yy_navigationItem.title = BILocalizedString(@"setting_title");
    self.yy_navigationBar.naviBgColor = BIColor(BIAppMainBGColor);

    self.settingView = [YYSettingView view];
    [self.view addSubview:self.settingView];
    [self.settingView reloadView:self.cellArray];
}

- (void)setupLayouts {
    [self.settingView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(0);
        make.top.mas_equalTo(BINavigationBarHeight);
    }];
}


@end
